﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5.Feature
{
    internal class CastSetter
    {
        public void SetCast(ref MovieJson movieJson, List<Cast> cast)
        {
            foreach (var member in cast)
            {
                var name = member.name.ToLowerInvariant();
                if (name.Equals("brad pitt"))
                    movieJson.isBradPitt = true;
                if (name.Equals("tom hanks"))
                    movieJson.isTomHanks = true;
                if (name.Equals("will smith"))
                    movieJson.isWillSmith = true;
                if (name.Equals("tom cruise"))
                    movieJson.isTomCruise = true;
                if (name.Equals("bradley cooper"))
                    movieJson.isBradleyCooper = true;
                if (name.Equals("johnny depp"))
                    movieJson.isJohnnyDepp = true;
                if (name.Equals("leonardo dicaprio"))
                    movieJson.isLeonardoDiCaprio = true;
                if (!movieJson.isBradPitt && !movieJson.isTomHanks && !movieJson.isWillSmith && !movieJson.isTomCruise && !movieJson.isBradleyCooper && !movieJson.isJohnnyDepp && !movieJson.isLeonardoDiCaprio)
                    movieJson.isOtherActor = true;
            }
        }
    }
}